Skip to content

[SYCL] Add lightweight free-function kernel property headers#21738

Merged
dm-vodopyanov merged 11 commits into
intel:syclfrom
koparasy:compile-time/function-properties
May 12, 2026
Merged

[SYCL] Add lightweight free-function kernel property headers#21738
dm-vodopyanov merged 11 commits into
intel:syclfrom
koparasy:compile-time/function-properties

Conversation

@koparasy
Copy link
Copy Markdown
Contributor

@koparasy koparasy commented Apr 10, 2026

Refactor the oneAPI kernel-property headers to separate the lightweight free-function annotation path from the heavier generic property-list machinery.

This change introduces a lighter include path for code that defines free-function kernels and only needs function-level annotations, while keeping the broader property-list APIs available through the umbrella headers.

Current header organization:

  • free_function_kernel_properties.hpp provides the lightweight free-function path, including:
    • single_task_kernel
    • nd_range_kernel
    • SYCL_EXT_ONEAPI_FUNCTION_PROPERTY
    • the standalone compile-time launch-tuning properties used directly on free-function kernel declarations
  • kernel_properties.hpp provides the broader kernel-properties interface, including:
    • properties_tag
    • property-list-oriented kernel properties such as device_has
    • the full kernel-properties entry point used by code that works with property lists or embedded kernel properties
  • properties.hpp provides the generic oneAPI properties list machinery:
    • properties
    • empty_properties_t

The previous nested include paths are kept as compatibility forwarding headers for now.

This split reduces compile-time overhead for kernel-language and JIT-style usage by avoiding unnecessary property-list metaprogramming on the free-function path.

A related semantic point is that generic properties{...} lists remain composable on their own, while cross-property validation that depends on kernel usage is performed in the kernel-property consumption path rather than during generic property-list formation.

This patch also updates the extension documentation to describe the current header organization in less prescriptive terms and adds compatibility coverage for the legacy forwarding headers.

Measured header compile times:

  • free_function_kernel_properties.hpp: ~29 ms
  • kernel_properties.hpp umbrella path: ~68 ms

@koparasy koparasy requested review from a team as code owners April 10, 2026 21:44
@koparasy koparasy requested a review from cperkinsintel April 10, 2026 21:44
@koparasy koparasy force-pushed the compile-time/function-properties branch from 8346075 to 295ad05 Compare April 10, 2026 22:12
Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_free_function_kernels.asciidoc Outdated
Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_free_function_kernels.asciidoc Outdated
Copy link
Copy Markdown
Contributor

@cperkinsintel cperkinsintel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

header / sycl stuff LGTM

Introduce lightweight kernel-property headers for free-function kernel
annotation and launch-tuning use cases:

- function_properties.hpp provides a standalone path for execution-kind
  annotations such as nd_range_kernel and single_task_kernel.
- function_launch_properties.hpp provides a lightweight path for launch
  properties such as work_group_size, work_group_size_hint, and
  sub_group_size.
- kernel_properties/properties.hpp remains the umbrella path for full
  property-list semantics and cross-property conflict checking.

This reduces compile-time cost for kernel-language and JIT-style usage
while preserving the full umbrella interface for users who need complete
property-list behavior.

Measured header compile times:
- function_properties.hpp: ~26 ms
- function_launch_properties path: ~58 ms
- kernel_properties/properties.hpp umbrella: ~68 ms
property headers instead of the nested kernel_properties/* paths.

Keep the legacy kernel_properties/* headers as forwarding compatibility
shims, add smoke tests for both legacy include paths, and mark the
shims for deletion once support for the old paths is dropped.
@koparasy koparasy force-pushed the compile-time/function-properties branch from ea6ac15 to faa95e1 Compare April 23, 2026 17:45
@koparasy koparasy requested review from a team as code owners April 23, 2026 17:45
@koparasy koparasy requested a review from adamfidel April 23, 2026 17:45
Copy link
Copy Markdown
Contributor

@sarnex sarnex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esimd lgtm

@koparasy koparasy marked this pull request as draft April 27, 2026 20:27
@koparasy koparasy marked this pull request as ready for review April 27, 2026 21:19
Copy link
Copy Markdown
Member

@adamfidel adamfidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graph change is good.

Co-authored-by: Copilot <copilot@github.com>
Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_free_function_kernels.asciidoc Outdated
Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_kernel_properties.asciidoc Outdated
Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_free_function_kernels.asciidoc Outdated
Copy link
Copy Markdown
Contributor

@gmlueck gmlueck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a minor comment about spec formatting below.

Comment thread sycl/doc/extensions/experimental/sycl_ext_oneapi_free_function_kernels.asciidoc Outdated
@dm-vodopyanov dm-vodopyanov merged commit bba4f4d into intel:sycl May 12, 2026
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants